<html>
<head><meta charset="utf-8"><title>Memory Usage · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html">Memory Usage</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199208570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199208570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199208570">(May 29 2020 at 20:34)</a>:</h4>
<p>rust-analyzer is eating all my goddamn memory</p>



<a name="199208684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199208684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199208684">(May 29 2020 at 20:35)</a>:</h4>
<p>Who wants a 23 GB core dump file from it running on Ubuntu?</p>



<a name="199208797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199208797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199208797">(May 29 2020 at 20:36)</a>:</h4>
<p>What size of a project have you opened with RA?</p>



<a name="199208995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199208995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199208995">(May 29 2020 at 20:38)</a>:</h4>
<p>It's not too big, it's just lol-html <a href="https://github.com/cloudflare/lol-html">https://github.com/cloudflare/lol-html</a></p>



<a name="199209148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199209148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199209148">(May 29 2020 at 20:39)</a>:</h4>
<p>Are you using vscode?</p>



<a name="199209276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199209276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199209276">(May 29 2020 at 20:40)</a>:</h4>
<p>Yep</p>



<a name="199209312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199209312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199209312">(May 29 2020 at 20:41)</a>:</h4>
<p>Try running <code>Rust Analyzer: Status</code> command<br>
<a href="/user_uploads/4715/fx4KLIDK1v0MQ5dxB1HJ1O2X/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/fx4KLIDK1v0MQ5dxB1HJ1O2X/image.png" title="image.png"><img src="/user_uploads/4715/fx4KLIDK1v0MQ5dxB1HJ1O2X/image.png"></a></div>



<a name="199209352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199209352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199209352">(May 29 2020 at 20:41)</a>:</h4>
<p>Alright I'll try it once it happens again. Shouldn't be too long...</p>



<a name="199209359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199209359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199209359">(May 29 2020 at 20:41)</a>:</h4>
<p>&lt;kbd&gt;Ctrl+Shift+P&lt;/kbd&gt;</p>



<a name="199209466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199209466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199209466">(May 29 2020 at 20:42)</a>:</h4>
<p>Oh wait it has live updates, nice</p>



<a name="199416011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199416011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199416011">(Jun 01 2020 at 20:05)</a>:</h4>
<p>Caught it using almost 15 GB</p>
<div class="codehilite"><pre><span></span><code>workspaces:
140 packages loaded

analysis:
2429 (33mb) files
154143 (14mb) symbols
1495 trees, 159 retained
1052527 trees, 186 retained (macros)


memory:
0b allocated 0b resident
gc 16227 seconds ago

requests:
 12488 textDocument/codeAction             2ms
*12473 textDocument/codeAction             2ms
 12474 textDocument/documentHighlight      0ms
 12475 textDocument/codeAction             2ms
 12477 textDocument/codeAction             2ms
 12478 textDocument/codeAction             5ms
 12481 textDocument/codeAction             2ms
 12482 textDocument/codeAction             2ms
 12483 textDocument/codeAction             2ms
 12486 textDocument/codeAction             2ms
</code></pre></div>



<a name="199417333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199417333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199417333">(Jun 01 2020 at 20:17)</a>:</h4>
<p><span class="user-mention" data-user-id="216201">@Edwin Cheng</span> could this be something with interning the proc macros output?<br>
<code>1052527 trees, 186 retained (macros)</code> seems ridiculous, but I may be wrong...</p>



<a name="199417460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199417460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199417460">(Jun 01 2020 at 20:18)</a>:</h4>
<p>proc macor enabled ?</p>



<a name="199417555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199417555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199417555">(Jun 01 2020 at 20:19)</a>:</h4>
<p><a href="/user_uploads/4715/0BD1xV1j0uYDHZ06k3PPAcgX/image.png">image.png</a> <br>
nope</p>
<div class="message_inline_image"><a href="/user_uploads/4715/0BD1xV1j0uYDHZ06k3PPAcgX/image.png" title="image.png"><img src="/user_uploads/4715/0BD1xV1j0uYDHZ06k3PPAcgX/image.png"></a></div>



<a name="199417633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199417633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199417633">(Jun 01 2020 at 20:20)</a>:</h4>
<p><span class="user-mention" data-user-id="240522">@Sydney Acksman</span>, also, what if you run <code>Rust Analyzer: run garbage collection</code> when you catch such a spike? (I am really just blindly guessing, I'd love if we could get some kind of stable reproduction....)</p>



<a name="199417685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199417685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199417685">(Jun 01 2020 at 20:20)</a>:</h4>
<p>Sometimes it collects, but if the garbage becomes too much it just doesn't work and I have to kill it.</p>



<a name="199417837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199417837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199417837">(Jun 01 2020 at 20:22)</a>:</h4>
<p>Collects as in "all the gigabytes are freed"?</p>



<a name="199417846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199417846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199417846">(Jun 01 2020 at 20:22)</a>:</h4>
<p>Yep.</p>



<a name="199417868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199417868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199417868">(Jun 01 2020 at 20:22)</a>:</h4>
<p>Hmm, that's at least something...</p>



<a name="199418069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418069">(Jun 01 2020 at 20:24)</a>:</h4>
<p>Proc macro is not gc-abled. So I think it is not related. What platform you are in ? Are you working on Win32 related API? (winapi crate is one of the crate used macro heavily)</p>



<a name="199418081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418081">(Jun 01 2020 at 20:24)</a>:</h4>
<p>Also, what version are you running?<br>
<a href="user_uploads/4715/8NzqmrSEtDbR7LoXTA3H5aq-/image.png">image.png</a></p>
<div class="message_inline_image"><a href="user_uploads/4715/8NzqmrSEtDbR7LoXTA3H5aq-/image.png" title="image.png"><img src="user_uploads/4715/8NzqmrSEtDbR7LoXTA3H5aq-/image.png"></a></div>



<a name="199418172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418172">(Jun 01 2020 at 20:25)</a>:</h4>
<p>Ubuntu with VS Code<br>
Version is 05-25</p>



<a name="199418266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418266">(Jun 01 2020 at 20:26)</a>:</h4>
<p>Cores are throwing work at each other non-stop. <a href="/user_uploads/4715/6MoeD4gmDDrEeKsynSApV7jE/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/6MoeD4gmDDrEeKsynSApV7jE/image.png" title="image.png"><img src="/user_uploads/4715/6MoeD4gmDDrEeKsynSApV7jE/image.png"></a></div>



<a name="199418498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418498">(Jun 01 2020 at 20:27)</a>:</h4>
<p>Wow, that's hot :D</p>



<a name="199418650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418650">(Jun 01 2020 at 20:28)</a>:</h4>
<p>Plugged in laptop knows no bounds (except max operating temp)</p>



<a name="199418758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418758">(Jun 01 2020 at 20:29)</a>:</h4>
<p>Is there any output in here (there should be <code>Rust Analyzer</code> entry, without the <code>Language Server Trace</code> channel)?<br>
<a href="/user_uploads/4715/XR0L_2pCAr8zloUgfCSktX4I/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/XR0L_2pCAr8zloUgfCSktX4I/image.png" title="image.png"><img src="/user_uploads/4715/XR0L_2pCAr8zloUgfCSktX4I/image.png"></a></div>



<a name="199418937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418937">(Jun 01 2020 at 20:30)</a>:</h4>
<div class="codehilite"><pre><span></span><code>[ERROR rust_analyzer::main_loop] overly long loop turn: 1.68208508s

thread &#39;&lt;unknown&gt;&#39; has overflowed its stack
fatal runtime error: stack overflow
[Info  - 3:21:16 PM] Connection to server got closed. Server will restart.

thread &#39;&lt;unknown&gt;&#39; has overflowed its stack
fatal runtime error: stack overflow
[Info  - 3:25:20 PM] Connection to server got closed. Server will restart.

thread &#39;&lt;unknown&gt;&#39; has overflowed its stack
fatal runtime error: stack overflow
[Info  - 3:28:49 PM] Connection to server got closed. Server will restart.
</code></pre></div>



<a name="199418989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199418989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199418989">(Jun 01 2020 at 20:31)</a>:</h4>
<p>There's a lot of "long loop turn" entries. Some as long as 479 seconds (which may be my computer going to sleep).</p>



<a name="199419044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199419044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199419044">(Jun 01 2020 at 20:31)</a>:</h4>
<div class="codehilite"><pre><span></span><code>thread &#39;&lt;unknown&gt;&#39; has overflowed its stack
fatal runtime error: stack overflow
[Info  - 3:28:49 PM] Connection to server got closed. Server will restart.
</code></pre></div>


<p>Are there many more entires of this?</p>



<a name="199419156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199419156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199419156">(Jun 01 2020 at 20:32)</a>:</h4>
<p>Yep, 2 more above the loop turns</p>



<a name="199419201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199419201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199419201">(Jun 01 2020 at 20:32)</a>:</h4>
<div class="codehilite"><pre><span></span><code>thread &#39;&lt;unknown&gt;&#39; has overflowed its stack
fatal runtime error: stack overflow
[Info  - 3:06:07 PM] Connection to server got closed. Server will restart.

thread &#39;&lt;unknown&gt;&#39; has overflowed its stack
fatal runtime error: stack overflow
[Info  - 3:09:08 PM] Connection to server got closed. Server will restart.
</code></pre></div>



<a name="199419299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199419299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199419299">(Jun 01 2020 at 20:33)</a>:</h4>
<p>Hm, I would expect there to be hundreds of such log entries. I am not sure how we handle the stack overflow of proc macros (or maybe it is our bad? cc <span class="user-mention" data-user-id="216201">@Edwin Cheng</span> ), but maybe this could lead to some memory leak?</p>



<a name="199419414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199419414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199419414">(Jun 01 2020 at 20:34)</a>:</h4>
<p>Also, the fact that we run proc macro server when proc macros are disabled is strange...</p>



<a name="199419469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199419469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199419469">(Jun 01 2020 at 20:34)</a>:</h4>
<p><span class="user-mention" data-user-id="247335">@Veetaha</span> Why you think it is proc-macro?</p>



<a name="199419534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199419534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199419534">(Jun 01 2020 at 20:35)</a>:</h4>
<p>Maybe <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4453">https://github.com/rust-analyzer/rust-analyzer/issues/4453</a></p>



<a name="199419637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199419637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199419637">(Jun 01 2020 at 20:36)</a>:</h4>
<p>Hmm, yes I'm wrong, it seems like <code>vscode-lanugageclient</code> restarts <code>rust-analyzer</code></p>



<a name="199426109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199426109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199426109">(Jun 01 2020 at 21:26)</a>:</h4>
<p>Are you doing anything... interesting when it occurs? or editing a particular file?</p>



<a name="199426142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199426142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199426142">(Jun 01 2020 at 21:26)</a>:</h4>
<p>I'm on windows and memory usage is fairly low</p>



<a name="199428533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199428533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199428533">(Jun 01 2020 at 21:50)</a>:</h4>
<p>I've found a file that causes it: <a href="https://github.com/cloudflare/lol-html/blob/master/src/rewriter/mod.rs">https://github.com/cloudflare/lol-html/blob/master/src/rewriter/mod.rs</a></p>



<a name="199428576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199428576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199428576">(Jun 01 2020 at 21:51)</a>:</h4>
<p>Just holding this file open leaks memory like crazy.</p>



<a name="199429162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199429162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199429162">(Jun 01 2020 at 21:58)</a>:</h4>
<p>What happend you comment this line ? <a href="https://github.com/cloudflare/lol-html/blob/344063e669731f8151a4b506d85f3fa4cc0fbd8a/src/rewriter/mod.rs#L533">https://github.com/cloudflare/lol-html/blob/344063e669731f8151a4b506d85f3fa4cc0fbd8a/src/rewriter/mod.rs#L533</a></p>



<a name="199430048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199430048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199430048">(Jun 01 2020 at 22:08)</a>:</h4>
<p>Nothing, it's still leaking</p>



<a name="199430305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199430305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199430305">(Jun 01 2020 at 22:11)</a>:</h4>
<p>One more question, you use using cargo nightly ?</p>



<a name="199430632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199430632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sydney Acksman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199430632">(Jun 01 2020 at 22:15)</a>:</h4>
<p>No, cargo is 1.43.0</p>



<a name="199430931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199430931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199430931">(Jun 01 2020 at 22:19)</a>:</h4>
<p>I guess it is related to proc-macro ? But I can't confirm that, maybe need time to investigate. But recently I don't have much time available ..</p>



<a name="199433027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199433027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199433027">(Jun 01 2020 at 22:48)</a>:</h4>
<p>I have the same behavior:<br>
<a href="/user_uploads/4715/UJloAcrbWamKLu0p8Yqko1XQ/image.png">image.png</a> <br>
What is weird is that closing vscode doesn't help. For some reason there is a stray <code>rust-analyzer</code> process left. I wonder who doesn't cleanup <code>vscode-languageclient</code> or <code>we</code>?</p>
<div class="message_inline_image"><a href="/user_uploads/4715/UJloAcrbWamKLu0p8Yqko1XQ/image.png" title="image.png"><img src="/user_uploads/4715/UJloAcrbWamKLu0p8Yqko1XQ/image.png"></a></div>



<a name="199433077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199433077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199433077">(Jun 01 2020 at 22:49)</a>:</h4>
<p><span class="user-mention" data-user-id="240522">@Sydney Acksman</span>  thanks for the repo!</p>



<a name="199433870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199433870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199433870">(Jun 01 2020 at 22:58)</a>:</h4>
<p>Openned an issue <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4698">here</a></p>



<a name="199455070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199455070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199455070">(Jun 02 2020 at 06:47)</a>:</h4>
<p>Why would it be related to proc macros? They're disabled and <code>parse_macro</code> seems to be related to MBE? And it seemed to me that MBE tends to expand or parse too much.</p>



<a name="199482825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/199482825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#199482825">(Jun 02 2020 at 12:23)</a>:</h4>
<p>I can reproduce it too</p>



<a name="230510237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230510237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230510237">(Mar 16 2021 at 13:20)</a>:</h4>
<p>Hey, <span class="user-mention" data-user-id="211727">@Jonas Schievink  [he/him]</span> , did you get a chance to further look into <a href="https://github.com/rust-analyzer/rust-analyzer/issues/7330">https://github.com/rust-analyzer/rust-analyzer/issues/7330</a> ?</p>



<a name="230511799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230511799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230511799">(Mar 16 2021 at 13:31)</a>:</h4>
<p>Not much, I'm not really sure what the best interning solution is yet</p>



<a name="230511913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230511913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230511913">(Mar 16 2021 at 13:32)</a>:</h4>
<p><code>internment</code> offers Arc-based interning like I mentioned in that issue, so probably that</p>



<a name="230515458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230515458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230515458">(Mar 16 2021 at 13:55)</a>:</h4>
<p>Yeah, that might work. Although I am wonder if there are any "out-of-the-box" solutions here? I've been watching hand made hero (a guy codes a game from scratch, using only a C compiler, bare hands and loads of almond milk), and one interesting point made there is that RAII is bad, because it encourages creation and destruction of items "one by one". In reality though, you almost always want "many" of something, which you want to create and destroy in waves. Sort-of low-level "pets vs cattle" thing. </p>
<p>That's exactly what happens with type refs, paths, and other similar things. They are individually allocated droplets of heap data pointing at each other, but I think most of the time we want either:</p>
<ul>
<li>create a bunch of them and persist them in db</li>
<li>create them in some temporary scratch space</li>
</ul>
<p>I wonder if we should add a mutex-protected slot-map to DB to allocae things?</p>



<a name="230518692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230518692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230518692">(Mar 16 2021 at 14:14)</a>:</h4>
<p>hmm, interesting</p>



<a name="230518731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230518731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230518731">(Mar 16 2021 at 14:14)</a>:</h4>
<p>though that sounds less out-of-the-box than just using an existing crate</p>



<a name="230518845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230518845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230518845">(Mar 16 2021 at 14:15)</a>:</h4>
<p>is the concern here that RAII of individual interned handles is too expensive because they contain <code>Arc</code>s?</p>



<a name="230520012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230520012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230520012">(Mar 16 2021 at 14:22)</a>:</h4>
<p>It's more that now everything needs to include the code to drop the things in case of panic, as opposed to bumpallo-like freeing in bunch.</p>



<a name="230520674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230520674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230520674">(Mar 16 2021 at 14:25)</a>:</h4>
<p>The salsa interning provides a way to do something like that</p>



<a name="230520841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230520841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230520841">(Mar 16 2021 at 14:26)</a>:</h4>
<p>I wanted to add non-salsa interning because it is inconvenient to need a db everytime I want to intern or access interned data</p>



<a name="230521379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/230521379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#230521379">(Mar 16 2021 at 14:29)</a>:</h4>
<p>Hm, I think therading the context might be the right soln long-term. I am not a huge fan of truly global tables.</p>



<a name="233126892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/233126892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#233126892">(Apr 05 2021 at 01:32)</a>:</h4>
<blockquote>
<p>99mb FileItemTreeQuery</p>
</blockquote>
<p>First time I got it under 100 MB <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="233130249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/233130249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#233130249">(Apr 05 2021 at 02:36)</a>:</h4>
<blockquote>
<p>80mb FileItemTreeQuery</p>
</blockquote>
<p>Interning is making the memory usage stats inaccurate, but I'm counting this as a success anyways.</p>
<p>Item trees now use "only" as much memory as the raw source code.</p>



<a name="233154613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Memory%20Usage/near/233154613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Memory.20Usage.html#233154613">(Apr 05 2021 at 09:49)</a>:</h4>
<p>Impressive work <span class="user-mention" data-user-id="211727">@Jonas Schievink  [he/him]</span> !</p>
<p>This will be the <em>smooooooolst</em> release of rust-analyzer</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>